$OpenBSD: patch-base_sys_info_openbsd_cc,v 1.10 2016/09/01 16:28:11 robert Exp $
--- base/sys_info_openbsd.cc.orig.port	Thu Sep  1 00:03:26 2016
+++ base/sys_info_openbsd.cc	Thu Sep  1 11:44:07 2016
@@ -29,6 +29,8 @@ int64_t AmountOfMemory(int pages_name) {
 
 namespace base {
 
+int64_t aofpmem = 0;
+
 // static
 int SysInfo::NumberOfProcessors() {
   int mib[] = { CTL_HW, HW_NCPU };
@@ -43,24 +45,10 @@ int SysInfo::NumberOfProcessors() {
 
 // static
 int64_t SysInfo::AmountOfPhysicalMemory() {
-  return AmountOfMemory(_SC_PHYS_PAGES);
-}
-
-// static
-int64_t SysInfo::AmountOfAvailablePhysicalMemory() {
-  return AmountOfMemory(_SC_AVPHYS_PAGES);
-}
-
-// static
-uint64_t SysInfo::MaxSharedMemorySize() {
-  int mib[] = { CTL_KERN, KERN_SHMINFO, KERN_SHMINFO_SHMMAX };
-  size_t limit;
-  size_t size = sizeof(limit);
-  if (sysctl(mib, arraysize(mib), &limit, &size, NULL, 0) < 0) {
-    NOTREACHED();
-    return 0;
-  }
-  return static_cast<uint64_t>(limit);
+  // pledge(2)
+  if (!aofpmem)
+    aofpmem = AmountOfMemory(_SC_PHYS_PAGES);
+  return aofpmem;
 }
 
 // static
